<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>模型增加</title>
<link rel="stylesheet" href="../../../files/css/layui.css" media="all">
<style type="text/css">
#goodsImg {
	position: relative;
	left: 110px;
}
</style>
</head>
<body>

	<fieldset class="layui-elem-field layui-field-title"
		style="margin-top: 20px;">
		<legend>模型增加列表</legend>
	</fieldset>

	<form class="layui-form" action="../../../module/saveOrUpdate.action"
		method="post">

		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">上级模块</label>
				<div class="layui-input-inline" id="goods">
					<select name="onModId" id="onModId" lay-verify="required"
						lay-search="">
						<option value="1">------选择上级模块------</option>
					</select>
				</div>
			</div>
		</div>


		<div class="layui-form-item">
			<label class="layui-form-label">模块url</label>
			<div class="layui-input-inline">
				<input type="text" name="url" id="url" required
					lay-verify="required" placeholder="请输入用户名" maxlength="9"
					autocomplete="off" class="layui-input">
			</div>
		</div>

		<div class="layui-form-item">
			<label class="layui-form-label">模块名称</label>
			<div class="layui-input-inline">
				<input type="text" name="modName" id="modName" lay-verify="required"
					placeholder="请输入" autocomplete="off" class="layui-input">
			</div>
		</div>

		<div class="layui-form-item">
			<label class="layui-form-label">模型编码</label>
			<div class="layui-input-inline">
				<input type="text" name="modCode" required="required" value="UTF-8"
					lay-verify="required" placeholder="请输入" autocomplete="off"
					class="layui-input">
			</div>
		</div>

		<div class="layui-form-item layui-form-text">
			<label class="layui-form-label">备注</label>
			<div class="layui-input-inline">
				<textarea placeholder="请输入内容" name="modDesc" class="layui-textarea"></textarea>
			</div>
		</div>

		<div class="layui-form-item">
				<label class="layui-form-label">是否有效</label>
				<div class="layui-input-inline">
					<select name="isva" id="isva" required="required">
						<option value="0">无效</option>
						<option value="1">有效</option>
					</select>
				</div>
			</div>
		</div>

		<div class="layui-form-item">
			<div class="layui-input-block">
				<input onclick="aa()" type="submit" class="layui-btn" lay-submit=""
					lay-filter="imgAdd" value="立即增加">
				<button type="reset" class="layui-btn layui-btn-primary">重置</button>
			</div>
		</div>
	</form>



	<script src="../../../files/js/layui.js"></script>
	<script type="text/javascript" src="../../../commom/js/base.js"></script>
	<script type="text/javascript" src="../../../files/js/jquery.min.js"></script>
	<script>
		layui.use('form', function() {
			var form = layui.form, layer = layui.layer, $ = layui.$;
			form.on('submit(imgAdd)', function() {
				parent.location.reload(); // 父页面刷新
			});

			$.ajax({
				async : false,
				url : getRootPath() + 'module/findAll.action',
				data : null,
				success : function(data) {
					var msg = data[1];
					for (var i = 0; i < msg.length; i++) {
						$("#onModId").append(
								"<option value="+msg[i].modId+">"
										+ msg[i].modName + "</option>");
						form.render('select');
					}
				}

			});

		});
	</script>

</body>
</html>